<script type="text/javascript">
  quickSignInVal();
</script>
<nav class="navbar navbar-default" role="navigation">
  <div class="navbar-header">
    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#loobica-navbar">
      <span class="sr-only">Toggle navigation</span>
      <span class="icon-bar"></span>
      <span class="icon-bar"></span>
      <span class="icon-bar"></span>
    </button>
  </div>
  <div class="collapse navbar-collapse navbar-right" id="loobica-navbar">
    <ul class="nav navbar-nav">
      <li <?php if (!empty($menu_active) && $menu_active == 'publish_advert') { ?> class="active" <?php } ?>><a href="<?php echo site_url('advert/publish'); ?>" class="route-controller"><i class="fa fa-briefcase"></i>&nbsp;<span><?php echo lang('publish_an_advert'); ?></span></a></li>
    </ul>
    <ul class="nav navbar-nav divider-vertical"></ul>
    <?php if (!empty($this->signed_user)) { ?>
      <ul class="nav navbar-nav">
        <li class="dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown"><span><i class="fa fa-user"></i>&nbsp;<?php echo $this->signed_user['user_email']; ?></span>&nbsp;<b class="caret"></b></a>
          <ul class="dropdown-menu quick-sign-in-menu">
            <li>
              <a class="route-controller" href="<?php echo site_url('user/profile'); ?>"><i class="fa fa-user"></i>&nbsp;<span><?php echo lang('profile'); ?></span></a>
            </li>
            <li>
              <a class="route-controller" href="<?php echo site_url('settings'); ?>"><i class="fa fa-cog"></i>&nbsp;<span><?php echo lang('settings'); ?></span></a>
            </li>
            <li class="divider"></li>
            <li>
              <a class="route-controller-non" href="<?php echo site_url('signout'); ?>"><i class="fa fa-sign-out"></i>&nbsp;<span><?php echo lang('sign_out'); ?></span></a>
            </li>
          </ul>
        </li>
      </ul>
    <?php } else { ?>
      <ul class="nav navbar-nav">
        <li><a class="route-controller" href="<?php echo site_url('signup'); ?>"><?php echo lang('sign_up'); ?></a></li>
        <li id="quick_sign_in_dropdown" class="dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown"><span><?php echo lang('sign_in'); ?></span>&nbsp;<b class="caret"></b></a>
          <ul class="dropdown-menu quick-sign-in-menu" style="width: 300px;">
            <li>
              <div class="row">
                <div class="col-sm-12">
                  <form id="quick_sign_in_form" class="form" role="form" method="post" action="<?php echo site_url('signin'); ?>" url="<?php echo site_url('signin'); ?>">
                    <?php if ($this->input->is_ajax_request()) { ?>
                      <input type="hidden" name="redirect_to" id="redirect_to" value=""/>
                    <?php } else { ?>
                      <input type="hidden" name="redirect_to" id="redirect_to" value="<?php echo current_full_url(); ?>"/>
                    <?php } ?>
                    <div class="form-group">
                      <label class="sr-only" for="user_email"><?php echo lang('email'); ?></label>
                      <input type="email" name="user_email" class="form-control" id="user_email" placeholder="Email" required="true">
                    </div>
                    <div class="form-group">
                      <label class="sr-only" for="user_password"><?php echo lang('password'); ?></label>
                      <input type="password" name="user_password" class="form-control" id="user_password" placeholder="Password" required="true">
                    </div>
                    <div class="form-group">
                      <button class="btn btn-danger btn-block" type="submit"><i class="fa fa-sign-in"></i>&nbsp;<span><?php echo lang('sign_in'); ?></span></button>
                    </div>
                  </form>
                  <span class="text-info pull-right"><a class="route-controller" href="<?php echo site_url('password/reset'); ?>"><i class="fa fa-external-link"></i>&nbsp;<span><?php echo lang('password_reset'); ?></span></a></span>
                </div>
              </div>
            </li>
            <li class="divider"></li>
            <li>
              <p class="col-sm-6">
                <a title="<?php echo lang('sign_in_up_via_facebook'); ?>" href="<?php echo site_url('auth/facebook'); ?>" class="btn btn-primary btn-block"><i class="fa fa-facebook-square"></i>&nbsp;Facebook</a>
              </p>
              <p class="col-sm-6">
                <a title="<?php echo lang('sign_in_up_via_google'); ?>" href="<?php echo site_url('auth/google'); ?>" class="btn btn-primary btn-block"><i class="fa fa-google-plus-square"></i>&nbsp;Google</a>
              </p>
            </li>
          </ul>
        </li>
      </ul>
    <?php } ?>
  </div>
</nav>